/*
 * @Author: your name
 * @Date: 2019-11-27 09:05:29
 * @LastEditTime: 2019-12-03 19:42:08
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \web\avue-cli\src\api\equipment\device\management.js
 */
import request from '@/router/axios';
import qs from 'qs';


/**
 * @description: 条件分页查询所有 培训人员列表
 * @param {object}
 * @return:promise
 */

// 培训管理 --- 条件分页查询
export const getTrainFormList= (data = {}) => request({
  url: `/trainManagement/v1/pageQuery?page=${data.page}&size=${data.size}`,
  method: "post",
  data: data.trainManagement
})

// 添加培训计划
export const addTrainFormList = (data = {}) => request({
  url: '/trainManagement/v1/insert',
  method: 'post',
  data: data
})

// 修改
export const updateTrainFormList = (data = {}) => request({
  url: '/trainManagement/v1/update',
  method: 'post',
  data: data
})

// 根据主键删除
export const deleteTrainFormList = (data = {}) => request({
  url: '/trainManagement/v1/getById',
  method: 'post',
  data: qs.stringify(data)
})

// 添加培训计划---单个文件上传
export const upLoadFile = (data = {}) => request({
  url: '/fileManage/v1/insert/upload',
  method: 'post',
  data: qs.stringify(data)
})

// 根据主键查询
export const getTrainManagementById= (data = {}) => request({
  url: '/trainManagement/v1/findById',
  method: "post",
  data: qs.stringify(data)
})

// 培训总结
export const updateTrainSummary= (data = {}) => request({
  url: '/trainManagement/v1/updateTrainSummary',
  method: "post",
  data: data
})

// 查询设备异常数量
export const findEquipmentIsStatusNum= (data = {}) => request({
  url: '/equipment/v1/findEquipmentIsStatusNum',
  method: "post",
  data: data
})